package cn.murky.tenant.system.biz.controller;

import cn.murky.core.web.ApiResult;
import cn.murky.core.web.BaseController;
import cn.murky.tenant.system.biz.service.ISysI18nService;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Get;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.validation.annotation.NotBlank;
import org.noear.solon.validation.annotation.NotEmpty;
import org.noear.solon.validation.annotation.Valid;

import java.util.List;
import java.util.Map;


/***
 * i18n管理
 *
 * @auth hans
 */
@Controller
@Valid
@Mapping("i18n")
public class TenantI18nController extends BaseController<ISysI18nService> {
    /**
     * i18n语言包
     * @param i18nTag i18n标签
     * @param laguage 语言
     */
    @Get
    @Mapping("language")
    @Valid
    public ApiResult<Map<String, String>> language(@NotEmpty List<String> i18nTag, @NotBlank String laguage) {
        return ApiResult.ok(baseService.language(i18nTag, laguage));
    }
}
